package br.ufc.great.client;

import java.util.Vector;

import br.ufc.great.xml.XMLElement;

/**
 * 
 * @author Leonardo Oliveira Moreira
 *
 * Classe que representa uma opera��o de inser��o
 */
public class DTXInsertOperation extends DTXOperation {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 5264487310294287983L;
	public static final int BEFORE = 1;
	public static final int INTO = 2;	
	public static final int AFTER = 3;
	
	private String query;
	private XMLElement constructor;
	private int insertType;
	
	public DTXInsertOperation(String id, Vector<DTXSite> sites, String query, int type, XMLElement constructor) {
		super(id, sites, DTXOperation.INSERT);
		this.query = query;
		insertType = type;
		this.constructor = constructor;
	}

	/**
	 * Método que resgata o elemento construtor configurado
	 * 
	 * @return
	 */
	public XMLElement getConstructor() {
		return constructor;
	}

	/**
	 * Método que resgata a consulta configurada
	 * 
	 * @return
	 */
	public String getQuery() {
		return query;
	}

	/**
	 * Método que resgata o tipo de inser��o configurada
	 * 
	 * @return
	 */
	public int getInsertType() {
		return insertType;
	}

}
